Skip to content

Redesign app updater with global status management and UI enhancements - #191

Merged
ProdigyV21 merged 6 commits into
ProdigyV21:mainfrom
Himanth-reddy:feature/improved-app-updater
May 15, 2026
Merged

Redesign app updater with global status management and UI enhancements#191
ProdigyV21 merged 6 commits into
ProdigyV21:mainfrom
Himanth-reddy:feature/improved-app-updater

Conversation

@Himanth-reddy

Copy link
Copy Markdown
Collaborator

This pull request introduces a comprehensive in-app update system for the application, including a user interface for update notifications and actions, and the necessary state management to support it. The update badge is now displayed in both the top bar and sidebar when an update is available, and a modal dialog guides users through the update process. The changes are grouped below by theme.

User Interface Enhancements for Updates:

  • Added an update badge indicator to both the AppTopBar and Sidebar components, visually alerting users when an update is available. The badge appears as a red dot on the settings gear icon in the top bar and the settings icon in the sidebar. (AppTopBar.kt, Sidebar.kt) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

  • Introduced a new AppUpdateModal composable, which displays a modal dialog guiding users through the app update process, including states for checking, downloading, installing, failures, and update notes. The modal provides contextual action buttons and progress indicators. (AppUpdateModal.kt, HomeScreen.kt) [1] [2]

State Management and ViewModel Integration:

  • Extended HomeUiState to include update-related properties: updateStatus, showAppUpdateDialog, and hasUpdateBadge, enabling the UI to react to update events and display the appropriate indicators and dialogs. (HomeViewModel.kt)

  • Updated the HomeViewModel to inject and use new update-related repositories and managers (AppUpdateRepository, ApkDownloader, UpdatePreferences, UpdateStatusManager), laying the groundwork for managing the update process and user preferences. (HomeViewModel.kt)

These changes collectively provide users with a seamless and interactive in-app update experience, ensuring they are notified of new updates and can easily take action within the app.

- Restore original ARVIO layout and typography to AppUpdateModal while incorporating new UX retry flows
- Integrate global UpdateStatusManager across UI layers (HomeScreen, Settings, Modals)
- Add proactive red notification badges to TopBar and Sidebar for available updates
- Gracefully handle PackageInstaller callback states through ApkInstallReceiver
- Remove temporary test code and clean up legacy inline dialog fields
…ign buttons

- Remove force-open state from HomeViewModel and SettingsViewModel on every updateStatusManager progress emission.
- Instead, only auto-open the dialog when first discovering a new un-ignored update.
- Refactor AppUpdateModal buttons to use a dynamic ActionButtonConfig list, ensuring the correct labels ('Install', 'Download', 'Retry', 'Hide') appear depending on the exact UX state, and preventing the D-pad from focusing on hidden buttons.
- Replaced persistent DataStore ignores with an in-memory sessionIgnoredTag in UpdateStatusManager. This ensures users are only unprompted during the current session, but will be notified again upon app restart.
- Added a cancelDownloadAppUpdate() function to both HomeViewModel and SettingsViewModel.
- Updated ApkDownloader and AppUpdateModal to show and handle the 'Cancel' button during active downloads.
@Himanth-reddy Himanth-reddy added the enhancement New feature or request label May 14, 2026
@ProdigyV21

Copy link
Copy Markdown
Owner

Thanks, this is a good direction and the merge build passes for both Play and Sideload.

I would like a few cleanups before merging:

  1. PackageInstaller failure retry can become a no-op
    ApkInstallReceiver sets UpdateStatus.Failure(userMessage) without attaching the AppUpdate. The modal then shows a Retry action, but downloadAppUpdate() only retries a Failure when Failure.update is non-null, so after an install failure/cancel the Retry button may do nothing. Please keep enough update context for retry, or make the failure action re-check for updates first.

  2. “Ignore” is now session-only
    ignoreAppUpdate() now uses sessionIgnoredTag instead of persisting the ignored release via UpdatePreferences. That means the same ignored update can appear again after app restart. If this is intentional, maybe label it “Later”/“Dismiss” instead of “Ignore”. If “Ignore” should mean ignore this release, please keep writing the tag to UpdatePreferences.

  3. git diff --check fails
    There is trailing whitespace in HomeViewModel.kt and SettingsViewModel.kt. Not a runtime issue, but it should be cleaned up before merge.

@Himanth-reddy Himanth-reddy left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented the review cleanups.

Changes:

UpdateStatusManager now remembers the last AppUpdate context and attaches it to context-free Failure statuses, so PackageInstaller failure/cancel retry can download again.
Ignore persists the release tag again via UpdatePreferences in both Home and Settings.
Home update badge/dialog suppression now checks the persisted ignored tag after restart.
Trimmed trailing whitespace in the touched files.
Verified:

git diff --check passes.
./gradlew :app:assemblePlayDebug :app:assembleSideloadDebug passes. Existing deprecation/always-true warnings remain, but no build errors.

@ProdigyV21
ProdigyV21 merged commit 0e951a5 into ProdigyV21:main May 15, 2026
1 check passed
@Himanth-reddy Himanth-reddy added gssoc-approved level:advanced Advanced level task quality:exceptional Exceptional code implementation type:feature New feature or improvement type:design UI/UX design enhancements gssoc:approved GSSoC approved contribution quality:clean Clean code implementation and removed gssoc:approved quality:exceptional Exceptional code implementation labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gssoc:approved GSSoC approved contribution level:advanced Advanced level task quality:clean Clean code implementation type:design UI/UX design enhancements type:feature New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants